import fetch from 'node-fetch';
import dayjs from "dayjs";


const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));

let  flag=true
let num=0
const req =  async () => {
    let ids=[131,132,133,134]
    for (const id of ids) {
        await  delay(50)
        fetch("https://api.cloud.sz-trip.com/api/coupon/getCouponsByActivityIds", {
            "headers": {
                "accept": "application/json, text/plain, */*",
                "accept-language": "zh-CN,zh;q=0.9",
                "content-type": "application/x-www-form-urlencoded",
                "sec-ch-ua": "\"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"",
                "sec-ch-ua-mobile": "?0",
                "sec-ch-ua-platform": "\"Windows\"",
                "sec-fetch-dest": "empty",
                "sec-fetch-mode": "cors",
                "sec-fetch-site": "same-site"
            },
            "referrer": "https://m.cloud.sz-trip.com/wlCoupon2024?fromsource=share",
            "referrerPolicy": "no-referrer-when-downgrade",
            "body": `ids=${id}&is_all=1&token=b23b0e6a-b629-4527-9adc-f5f3110d7be9`,
            "method": "POST",
            "mode": "cors",
            "credentials": "omit"
        }).then(res => {

            return res.json()
        }).then(res=>{

                console.log(res.msg)


        });


    }


}
const main = async () => {

    req()

    // while (  flag   ) {
    //     await  req()
    //
    //
    // }


}

main()

